package com.zlx.xBiaoShop.controller;


import com.zlx.xBiaoShop.entity.Result;
import com.zlx.xBiaoShop.service.SysUserGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
* @Description sys_user_goods 控制器层
* @author admin
* @date 2020-12-05 17:52:12
*/
@RestController
@CrossOrigin
@RequestMapping("/sysUserGoods")
public class SysUserGoodsController{
    @Autowired
    private SysUserGoodsService sysUserGoodsService;
    /*
     * @Author Edward
     * @Description //收藏商品
     * @Date 23:27 2020/12/6
     * @Param []
     * @return com.zlx.xBiaoShop.entity.Result
     **/
    @PostMapping("favoriteGoods/{userId}/{goodsId}")
    public Result favoriteGoods(@PathVariable Integer userId,@PathVariable Integer goodsId){
        return sysUserGoodsService.favoriteGoods(userId,goodsId);
    }
    @GetMapping("isFavorate/{userId}/{goodsId}")
    public Result isFavorate(@PathVariable Integer userId,@PathVariable Integer goodsId){
        return new Result(sysUserGoodsService.isFavorate(userId,goodsId));
    }
}
